package com.shinbada.modules.sys.service;

import com.shinbada.core.service.CrudService;
import com.shinbada.modules.sys.entity.SysSetting;
import com.shinbada.modules.sys.mapper.SysSettingMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 系统配置Service
 *
 * @author initcap
 * @date 2021/3/12 17:35
 */
@Service
@Transactional(readOnly = true)
public class SysSettingService extends CrudService<SysSettingMapper, SysSetting> {

    @Override
    @Transactional(readOnly = false)
    public void save(SysSetting setting) {
        mapper.update(setting);
    }

    @Transactional(readOnly = false)
    public void init(SysSetting setting) {
        mapper.insert(setting);
    }
}